#include
<kfbxaxissystem.h>
By default, the KFbxScene lives in the Y-Up axis system. If the calling application whishes to change the default axis, it will need to define the new axis system and call the convert method with the scene as argument. The appropriated transforms will be applied to the first level objects of the scene only (objects whose parent is the scene itself). Children objects do not need to be transformed since they inherit from their parents. The adjustements will affect the translation animation curves and the objects pivots values (the rotation transformation is applied as a pre-rotation transform therefore the rotation animation curves do not need to be transformed). Once converted, the scene will have its axis definition changed to the new system.
For example:
KFbxScene* lScene = KFbxScene::Create(sdkmanager, "MyScene"); ... // the scene is filled with objects int dir; lScene->GetGlobalSettings().GetAxisSystem().GetUpVector(dir); // this returns the equivalent of KFbxAxisSystem::YAxis KFbxAxisSystem max; // we desire to convert the scene from Y-Up to Z-Up max.ConvertScene(lScene); lScene->GetGlobalSettings().GetAxisSystem().GetUpVector(dir); // this will now return the equivalent of KFbxAxisSystem::ZAxis
Definition at line 83 of file kfbxaxissystem.h.
Predefined axis systems. |
|
These static members define the axis system of the
most popular applications. |
|
static const KFbxAxisSystem | MayaZUp |
Predefined axis system: MayaZUp (UpVector =
+Z, FrontVector = -Y, CoordSystem = +X (RightHanded)). |
|
static const KFbxAxisSystem | MayaYUp |
Predefined axis system: MayaYUp (UpVector =
+Y, FrontVector = +Z, CoordSystem = +X (RightHanded)). |
|
static const KFbxAxisSystem | Max |
Predefined axis system: Max (UpVector = +Z,
FrontVector = -Y, CoordSystem = +X (RightHanded)). |
|
static const KFbxAxisSystem | Motionbuilder |
Predefined axis system: Motionbuilder
(UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)).
|
|
static const KFbxAxisSystem | OpenGL |
Predefined axis system: OpenGL (UpVector =
+Y, FrontVector = +Z, CoordSystem = +X (RightHanded)). |
|
static const KFbxAxisSystem | DirectX |
Predefined axis system: DirectX (UpVector =
+Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)). |
|
static const KFbxAxisSystem | Lightwave |
Predefined axis system: Lightwave (UpVector
= +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)). |
|
Constructor and Destructor |
|
KFbxAxisSystem (eUpVector pUpVector, eFrontVector pFrontVector, eCoorSystem pCoorSystem) | |
Constructor! |
|
KFbxAxisSystem (const KFbxAxisSystem &pAxisSystem) | |
Copy constructor! |
|
KFbxAxisSystem (const ePreDefinedAxisSystem pAxisSystem) | |
Constructor! |
|
virtual | ~KFbxAxisSystem () |
Destructor. |
|
Boolean operation. |
|
bool | operator== (const KFbxAxisSystem &pAxisSystem) const |
Equivalence operator. |
|
bool | operator!= (const KFbxAxisSystem &pAxisSystem) const |
Non-equivalence operator. |
|
Public Types |
|
enum | eUpVector
{ XAxis = 1, YAxis = 2, ZAxis = 3 } |
Specifies which canonical axis represents up
in the system (typically Y or Z). More... |
|
enum | eFrontVector
{ ParityEven = 1, ParityOdd = 2 } |
Vector with origin at the screen pointing
toward the camera. More... |
|
enum | eCoorSystem
{ RightHanded = 0, LeftHanded = 1 } |
Specifies the third vector of the system.
More... |
|
enum | ePreDefinedAxisSystem
{ eMayaZUp = 0, eMayaYUp, eMax, eMotionBuilder, eOpenGL, eDirectX, eLightwave } |
Enumeration that can be used to initialize a
new instance of this class with predefined configurations (see the
"Predefined axis systems" section). More... |
|
Public Member Functions |
|
KFbxAxisSystem & | operator= (const KFbxAxisSystem &pAxisSystem) |
Assignment operation. |
|
void | ConvertScene (KFbxScene *pScene) const |
Convert a scene to this axis system.
|
|
void | ConvertScene (KFbxScene *pScene, KFbxNode *pFbxRoot) const |
Convert a scene to this axis system by using
the specified node as an Fbx_Root. |
|
eUpVector | GetUpVector (int &pSign) const |
Returns the eUpVector this axis system and
get the sign of the axis. |
|
eCoorSystem | GetCoorSystem () const |
Accessor to the eCoorSystem of this object.
|
|
void | ConvertChildren (KFbxNode *pRoot, const KFbxAxisSystem &pSrcSystem) const |
Converts the children of the given node to
this axis system. |
|
Protected Member Functions |
|
void | ConvertTProperty (KArrayTemplate< KFbxNode * > &pNodes, const KFbxAxisSystem &pFrom) const |
Apply the axis conversion to the translation
property of the nodes. |
|
void | ConvertCurveNodes (KArrayTemplate< KFbxAnimCurveNode * > &pCurveNodes, const KFbxAxisSystem &pFrom) const |
Apply the axis conversion to the translation
animation curves. |
|
void | AdjustPreRotation (KFbxNode *pNode, const KFbxMatrix &pConversionRM) const |
Adjust the Pre rotation to orient the node
and children correctly. |
|
void | AdjustPivots (KFbxNode *pNode, const KFbxMatrix &pConversionRM) const |
Adjust the pivots of the node for the new
axis system. |
|
void | GetConversionMatrix (const KFbxAxisSystem &pFrom, KFbxMatrix &pConversionRM) const |
Computes the transformation matrix to pass
from the pFrom system to this one. |
|
void | AdjustLimits (KFbxNode *pNode, const KFbxMatrix &pConversionRM) const |
Adjust the node translation limits for the
new axis system. |
|
void | AdjustPoses (KFbxScene *pScene, const KFbxMatrix &pConversionRM) const |
Adjust all the poses in the pScene
for the new axis system. |
|
void | AdjustCamera (KFbxNode *pNode, const KFbxMatrix &pConversionRM) const |
Recompute the camera's up-vector for the new
axis system. |
|
void | AdjustCluster (KFbxNode *pNode, const KFbxMatrix &pConversionRM) const |
Adjust the node cluster's matrices for the
new axis system. |
|
void | ConvertChildren (KFbxNode *pRoot, const KFbxAxisSystem &pSrcSystem, bool pSubChildrenOnly) const |
This is the main function that will dispatch
all the calls of the "Adjust" methods. |
|
Protected Attributes |
|
KFbxAxis | mUpVector |
The up vector (and sign) of this object.
|
|
KFbxAxis | mFrontVector |
The front vector (and sign) of this object.
|
|
KFbxAxis | mCoorSystem |
The third vector (and sign) of this object.
|
|
Friends |
|
class | KFbxGlobalSettings |
Classes |
|
class | KFbxAxis |
enum eUpVector |
Specifies which canonical axis represents up in the system (typically Y or Z).
Definition at line 89 of file kfbxaxissystem.h.
enum eFrontVector |
Vector with origin at the screen pointing toward the camera.
This is a subset of enum eUpVector because axis cannot be repeated. We use the system of "parity" to define this vector because its value (X,Y or Z axis) really depends on the up-vector. The ePreDefinedAxisSystem list the up-vector, parity and coordinate system values for the predefined systems.
Definition at line 101 of file kfbxaxissystem.h.
enum eCoorSystem |
Specifies the third vector of the system.
The KFbxAxisSystem deduces the correct vector and direction based on this flag and the relationship with the up and front vectors. The ePreDefinedAxisSystem list the up-vector, parity and coordinate system values for the predefined systems.
Definition at line 111 of file kfbxaxissystem.h.
Enumeration that can be used to initialize a new instance of this class with predefined configurations (see the "Predefined axis systems" section).
Definition at line 119 of file kfbxaxissystem.h.
KFbxAxisSystem | ( | eUpVector | pUpVector, | |
eFrontVector | pFrontVector, | |||
eCoorSystem | pCoorSystem | |||
) |
Constructor!
pUpVector | Specify the up vector. | |
pFrontVector | Specify the front vector. | |
pCoorSystem | Specify RightHanded coordinate system or LeftHanded coordinate system. |
KFbxAxisSystem | ( | const KFbxAxisSystem & | pAxisSystem | ) |
Copy constructor!
pAxisSystem | Another KFbxAxisSystem object copied to this one. |
KFbxAxisSystem | ( | const ePreDefinedAxisSystem | pAxisSystem | ) |
Constructor!
pAxisSystem | Specify which predefined axis system to copy. |
virtual ~KFbxAxisSystem | ( | ) | [virtual] |
Destructor.
bool operator== | ( | const KFbxAxisSystem & | pAxisSystem | ) | const |
Equivalence operator.
pAxisSystem | The axis system to compare against this one. |
true
if these two axis systems are equal,
false
otherwise.bool operator!= | ( | const KFbxAxisSystem & | pAxisSystem | ) | const |
Non-equivalence operator.
pAxisSystem | The axis system to compare against this one. |
true
if these two axis systems are unequal,
false
otherwise.KFbxAxisSystem& operator= | ( | const KFbxAxisSystem & | pAxisSystem | ) |
Assignment operation.
pAxisSystem | Axis system assigned to this one. |
void ConvertScene | ( | KFbxScene * | pScene | ) | const |
Convert a scene to this axis system.
Sets the axis system of the scene to this system unit.
pScene | The scene to convert |
Convert a scene to this axis system by using the specified node as an Fbx_Root.
This is provided for backwards compatibility only and ConvertScene(KFbxScene* pScene) should be used instead when possible.
pScene | The scene to convert | |
pFbxRoot | The Fbx_Root node that will be transformed. |
Returns the eUpVector this axis system and get the sign of the axis.
pSign | The sign of the axis, 1 if up, -1 is down. |
eCoorSystem GetCoorSystem | ( | ) | const |
Accessor to the eCoorSystem of this object.
void ConvertChildren | ( | KFbxNode * | pRoot, | |
const KFbxAxisSystem & | pSrcSystem | |||
) | const |
Converts the children of the given node to this axis system.
Unlike the ConvertScene() method, this method does not set the axis system of the scene that the pRoot node belongs, nor does it adjust KFbxPoses as they are not stored under the scene, and not under a particular node.
pRoot | The node whose children are converted. | |
pSrcSystem | The source axis system. |
void ConvertTProperty | ( | KArrayTemplate< KFbxNode * > & | pNodes, | |
const KFbxAxisSystem & | pFrom | |||
) | const [protected] |
Apply the axis conversion to the translation property of the nodes.
void ConvertCurveNodes | ( | KArrayTemplate< KFbxAnimCurveNode * > & | pCurveNodes, | |
const KFbxAxisSystem & | pFrom | |||
) | const [protected] |
Apply the axis conversion to the translation animation curves.
void AdjustPreRotation | ( | KFbxNode * | pNode, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Adjust the Pre rotation to orient the node and children correctly.
void AdjustPivots | ( | KFbxNode * | pNode, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Adjust the pivots of the node for the new axis system.
void GetConversionMatrix | ( | const KFbxAxisSystem & | pFrom, | |
KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Computes the transformation matrix to pass from the pFrom system to this one.
void AdjustLimits | ( | KFbxNode * | pNode, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Adjust the node translation limits for the new axis system.
void AdjustPoses | ( | KFbxScene * | pScene, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Adjust all the poses in the pScene for the new axis system.
void AdjustCamera | ( | KFbxNode * | pNode, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Recompute the camera's up-vector for the new axis system.
void AdjustCluster | ( | KFbxNode * | pNode, | |
const KFbxMatrix & | pConversionRM | |||
) | const [protected] |
Adjust the node cluster's matrices for the new axis system.
void ConvertChildren | ( | KFbxNode * | pRoot, | |
const KFbxAxisSystem & | pSrcSystem, | |||
bool | pSubChildrenOnly | |||
) | const [protected] |
This is the main function that will dispatch all the calls of the "Adjust" methods.
friend class KFbxGlobalSettings [friend] |
Definition at line 308 of file kfbxaxissystem.h.
const KFbxAxisSystem MayaZUp
[static] |
Predefined axis system: MayaZUp (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded)).
Definition at line 185 of file kfbxaxissystem.h.
const KFbxAxisSystem MayaYUp
[static] |
Predefined axis system: MayaYUp (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)).
Definition at line 188 of file kfbxaxissystem.h.
const KFbxAxisSystem Max
[static] |
Predefined axis system: Max (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded)).
Definition at line 191 of file kfbxaxissystem.h.
const KFbxAxisSystem Motionbuilder
[static] |
Predefined axis system: Motionbuilder (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)).
Definition at line 194 of file kfbxaxissystem.h.
const KFbxAxisSystem OpenGL
[static] |
Predefined axis system: OpenGL (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)).
Definition at line 197 of file kfbxaxissystem.h.
const KFbxAxisSystem DirectX
[static] |
Predefined axis system: DirectX (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)).
Definition at line 200 of file kfbxaxissystem.h.
const KFbxAxisSystem Lightwave
[static] |
Predefined axis system: Lightwave (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)).
Definition at line 203 of file kfbxaxissystem.h.
The up vector (and sign) of this object.
Definition at line 266 of file kfbxaxissystem.h.
KFbxAxis
mFrontVector
[protected] |
The front vector (and sign) of this object.
Definition at line 269 of file kfbxaxissystem.h.
KFbxAxis
mCoorSystem
[protected] |
The third vector (and sign) of this object.
Definition at line 272 of file kfbxaxissystem.h.